<template>
  <div class="perm-detail">
    <div class="content">
      <div style="font-size: 14px">
        <span style="cursor: pointer" @click="cancal">
          <ArrowLeftOutlined />
          返回
        </span>
      </div>
      <div class="content-body">
        <div class="title">{{ currentItem.name }}</div>
        <a-tabs v-model:activeKey="activeKey">
          <a-tab-pane key="1" tab="基本信息">
            <detailaInfo @update-success="updateSuccess"></detailaInfo>
          </a-tab-pane>
          <a-tab-pane key="2" tab="关联角色">
            <detailbRole></detailbRole>
          </a-tab-pane>
        </a-tabs>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, inject, defineEmits, toRefs } from 'vue'
import { ArrowLeftOutlined } from '@ant-design/icons-vue'
import detailaInfo from './detailaInfo'
import detailbRole from './leftgroup/detailbRole'
const { currentItemId: currentItem, upperRol } = inject('roleParams')
const activeKey = ref('1')
const emit = defineEmits(['close-edit', 'update-success'])
const cancal = () => {
  emit('close-edit', false)
}
const updateSuccess = (modelRef) => {
  emit('update-success', modelRef)
  cancal()
}
</script>

<style lang="less" scoped>
.perm-detail {
  width: 100%;
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
  display: flex;
  background-color: #8c8c8c;
  padding: 15px;
  .content {
    width: 100%;
    height: 100%;
    background-color: white;
    box-sizing: border-box;
    padding: 5px 15px;
    .content-body {
      height: calc(100% - 17px);
      .title {
        font-size: 28px;
        font-weight: bolder;
      }
    }
  }
}
</style>
<style lang="less">
.perm-detail {
  .ant-tabs {
    height: auto !important;
    .ant-tabs-content {
      height: auto !important;
    }
  }
}
</style>
